package com.dmai.capacity.platform.common.model;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 客户开通按量付费表
 *
 * @author
 * @email
 * @date 2024-03-29 21:14:28
 */

@Data
public class OauthUserVolumeCharge implements Serializable {
    private static final long serialVersionUID = 1L;


    private Integer id;

    private Integer userid;

    private Integer capabilityId;

    private Integer state;

    private Date updateTime;

    @TableField(exist = false)
    private CapabilityPackage refrence;

    public OauthUserVolumeCharge(Integer userid, Integer capabilityId) {
        this.userid = userid;
        this.capabilityId = capabilityId;
    }

    public OauthUserVolumeCharge activate() {
        this.state = 1;
        this.updateTime = new Date();

        return this;
    }

    public OauthUserVolumeCharge deactivate() {
        this.state = 0;
        this.updateTime = new Date();

        return this;
    }
}
